<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>

	<meta charset="UTF-8">

	<title>凯盛项目管理系统</title>

	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<script type="text/javascript" src="js/bootstrap-tooltip.js"></script>

</head>

<body class="body">
	<div class="navbar navbar-fixed-top">

		<div class="navbar-inner">

			<div class="container">

				<a class="brand" href="#">凯盛项目管理系统</a>

			</div>

		</div>

	</div>
	<div class="container">

	  <div class="row">

		<div class="span3">

			<div style="padding: 8px 0;" class="well">

				<ul class="nav nav-list">

				  <li class="nav-header">${employeeproject_in_session.project.name }</li>

				  <li class="divider"></li>

				  <li class="active"><a href="project.jspx?_m=showProject&projectid=${employeeproject_in_session.projectid }"><i class="icon-white icon-home"></i>最新动态</a></li>

				  <li><a href="goal.jspx"><i class="icon-flag"></i>目标</a></li>

				  <li><a href="document.jspx"><i class="icon-folder-open"></i>资料库</a></li>

				  <li><a href="folder.jspx"><i class="icon-file"></i>文件共享</a></li>

				  <li><a href="contact.jspx"><i class="icon-user"></i>联系人</a></li>

				  <li><a href="idea.jspx"><i class="icon-fire"></i>想法</a></li>

				  <li><a href="#"><i class="icon-warning-sign"></i>Bug</a></li>

				  <li><a href="#"><i class="icon-cog"></i>项目设置</a></li>

				</ul>

			</div>

		</div>

		<div class="span6">
		  	<ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;">

				<li class="active">

					<i class="icon-th"></i>你在想什么？

				</li>

			</ul>

			<div class="wall">

				<form style="margin:0px" action="msg.jspx">

					<textarea name="" style="width:415px" rows="3" id="msg"></textarea>

					<input type="button" class="btn btn-primary" id="btn" value="发布"/>

				</form>

			</div>
			<a id="example" href="#" rel="tooltip" title="first tooltip">hover over me</a>
			<ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:20px">

				<li class="active">

					<i class="icon-th"></i>信息流

				</li>

			</ul>

			<div id="wall">

				

			</div>
		</div>

		<div class="span3">

			<div class="box">

				<div class="head">我的任务</div>

				<ul>
					<c:forEach items="${requestScope.myTaskList }" var="task">
						<li><a href=""></a>${task.name }</li>
					</c:forEach>

				</ul>

			</div>

		</div>

	  </div>

	</div>
	<script type="text/javascript">
	
		function getMsg(){
			$("#wall").text("");
			$.get("msg.jspx",function(result){
				$(result).each(function(){
    				$("#wall").append($("<div>" +this.msg.createtime +"		" + "<a id=\"tool\" rel=\"tooltip\" href=\"#\" title=\"你好\">" + this.employee.name + "</a>" + "----"+this.msg.content+"</div>"));
    			});
			});
			setTimeout("getMsg()",10000);
		};
		
		$(document).ready(function(){
			
			$("#btn").click(function(){
				var content = $("#msg").val();
				/*
				content = encodeURIComponent(content);
				alert(content);
				*/
				$.get("msg.jspx",{"_m":"save","content":content},function(result){
    				$("#wall").append($("<div>" +result.msg.createtime + "		" + "<a class=\"tool\" rel=\"tooltip\" href=\"#\" data-selector=true data-original-title=\"你好\">" + this.employee.name + "</a>" + "---" + result.msg.content));
				});
				
			});
		});
		$('#example').tooltip('show');
		$('.tool').tooltip('show');
		window.onload = getMsg;
	</script>
</body>

</html>
